<?php

namespace app\admin\model;

use think\Model;
use think\Db;

class Messages extends Model
{
    protected $table = 'messages';
    protected $crcateTime = 'create_time';
    protected $updataTime = false;

    public function get_messages($id){
        $res = db('messages')->where('a.article_id', $id)->field('a.*,b.name')->alias('a')->join('lan_users b','a.user_id=b.id')->select();
        // $res = Messages::all($id);
        return $res;
    }
}
